<template>
  <div>
    <!-- 添加或修改练习子对话框 -->
    <el-dialog :title="textMap[dialogStatus]" :visible.sync="visible" :before-close="beforeClose" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-row :gutter="10">
          <el-col :span="12">
            <el-form-item label="主表id" prop="primaryId">
              <el-input v-model="form.primaryId" placeholder="请输入主表id" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="产品id" prop="productId">
              <el-input v-model="form.productId" placeholder="请输入产品id" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="产品型号" prop="model">
              <el-input v-model="form.model" placeholder="请输入产品型号" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="数量" prop="number">
              <el-input v-model="form.number" placeholder="请输入数量" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="单价" prop="price">
              <el-input v-model="form.price" placeholder="请输入单价" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="税率" prop="tax">
              <el-input v-model="form.tax" placeholder="请输入税率" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="税额" prop="taxMoney">
              <el-input v-model="form.taxMoney" placeholder="请输入税额" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="金额" prop="money">
              <el-input v-model="form.money" placeholder="请输入金额" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="删除标志" prop="delFlag">
              <el-input v-model="form.delFlag" placeholder="请输入删除标志" />
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submit">确 定</el-button>
        <el-button @click="beforeClose">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { practices } from "@/api/business/practices";
import { editMixin } from '@/mixins/edit'

export default {
  name: "Practices",
  mixins: [ editMixin ],
  data() {
    return {
      //数据校验规则
      rules: {}
    };
  },
  props: {

  },
  created() {

  },
  methods: {
    //调用save接口
    callSave(form) {
      return new Promise(function(resolve, reject) {
        practices.save(form).then((res) => {
          resolve(res);
        }).catch((error) => {
          reject(error)
        });
      });
    },
  }
};
</script>
